
var tabs;
var panes;

function clickSheet(data, i, nodes){
    tabs.each(removeActiveTab);
    this.classList.add("is-active");
    changActivePane(i);
}

function removeActiveTab(data, i, nodes){
    this.classList.remove("is-active");
}

function changActivePane(index){
    panes.each(function(data, i, nodes){
        if(index == i){
            this.style = "";
        }else{
            this.style = "display: none;"
        }
    });
}

window.onload = function(){
    var excellTable = d3.select("#excelTable");
    tabs = excellTable.selectAll(".el-tabs__item");
    panes = excellTable.selectAll(".el-tab-pane");
    //绑定tab点击事件
    tabs.on("click", clickSheet);
    // console.log("卡片",panes)
}